package com.medi.business.service.impl;

import java.util.List;
import com.medi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.medi.business.mapper.DataConditionMapper;
import com.medi.business.domain.DataCondition;
import com.medi.business.service.IDataConditionService;

/**
 * 数据权限-过滤条件Service业务层处理
 * 
 * @author medi
 * @date 2024-09-13
 */
@Service
public class DataConditionServiceImpl implements IDataConditionService 
{
    @Autowired
    private DataConditionMapper dataConditionMapper;

    /**
     * 查询数据权限-过滤条件
     * 
     * @param id 数据权限-过滤条件主键
     * @return 数据权限-过滤条件
     */
    @Override
    public DataCondition selectDataConditionById(String id)
    {
        return dataConditionMapper.selectDataConditionById(id);
    }

    /**
     * 查询数据权限-过滤条件列表
     * 
     * @param dataCondition 数据权限-过滤条件
     * @return 数据权限-过滤条件
     */
    @Override
    public List<DataCondition> selectDataConditionList(DataCondition dataCondition)
    {
        return dataConditionMapper.selectDataConditionList(dataCondition);
    }

    /**
     * 新增数据权限-过滤条件
     * 
     * @param dataCondition 数据权限-过滤条件
     * @return 结果
     */
    @Override
    public int insertDataCondition(DataCondition dataCondition)
    {
        dataCondition.setCreateTime(DateUtils.getNowDate());
        return dataConditionMapper.insertDataCondition(dataCondition);
    }

    /**
     * 修改数据权限-过滤条件
     * 
     * @param dataCondition 数据权限-过滤条件
     * @return 结果
     */
    @Override
    public int updateDataCondition(DataCondition dataCondition)
    {
        dataCondition.setUpdateTime(DateUtils.getNowDate());
        return dataConditionMapper.updateDataCondition(dataCondition);
    }

    /**
     * 批量删除数据权限-过滤条件
     * 
     * @param ids 需要删除的数据权限-过滤条件主键
     * @return 结果
     */
    @Override
    public int deleteDataConditionByIds(String[] ids)
    {
        return dataConditionMapper.deleteDataConditionByIds(ids);
    }

    /**
     * 删除数据权限-过滤条件信息
     * 
     * @param id 数据权限-过滤条件主键
     * @return 结果
     */
    @Override
    public int deleteDataConditionById(String id)
    {
        return dataConditionMapper.deleteDataConditionById(id);
    }
}
